extends Panel


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	Global.set_player_skin.connect(func(skin:CompressedTexture2D):
		$"PlayerDisplayer".box_skin=skin
		play_anim()
		)
	pass # Replace with function body.

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass


func _on_default_toggled(toggled_on: bool) -> void:
	if toggled_on:
		Global.set_player_skin.emit($Scroll/HBox/Default.texture_normal)
	pass # Replace with function body.


func _on_man_toggled(toggled_on: bool) -> void:
	if toggled_on:
		$"../../../Audio/Man".play()
		Global.set_player_skin.emit($Scroll/HBox/Man.texture_normal)
	pass # Replace with function body.


func _on_kun_toggled(toggled_on: bool) -> void:
	if toggled_on:
		Global.set_player_skin.emit($Scroll/HBox/Kun.texture_normal)
	pass # Replace with function body.
var twn:Tween
var tween_delay:int=0
func play_anim()->void:
	if twn and twn.is_running():return
	twn= create_tween()
	twn.tween_property($PlayerDisplayer,"open_progress",0.5,0.2)
	twn.tween_callback(func():%Pectinoma.visible=true)
	twn.tween_property(self,"tween_delay",0,1)
	twn.tween_property($PlayerDisplayer,"open_progress",1.0,0.2)
	twn.tween_callback(func():%Pectinoma.visible=false)
	pass
